import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'

// 指定 RouteRecordRaw[] 类型后，书写的时候就有 TS 的类型提示和检查了
const routes: RouteRecordRaw[] = [
  {
    path: "/",
    redirect:'/home',
    children: [
      { path: "/home", component: () => import("@/views/home.vue") },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
  scrollBehavior: () => {
    return { top: 0 }
  }
})
export default router